package com.summer.mapper;

import com.summer.entity.TbActivityinfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.summer.vo.Activity;
import com.summer.vo.MyActivity;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author summer502
 * @since 2021-03-31
 */
@Repository
public interface TbActivityinfoMapper extends BaseMapper<TbActivityinfo> {
    @Select("select tb_sign.*,tb_activityinfo.*\n" +
            "from tb_sign ,tb_activityinfo \n" +
            "where  tb_activityinfo.activity_id=tb_sign.activity_id and tb_sign.sign_user_id=#{sign_user_id}")
    List<MyActivity> selectListMyactivity(String  sign_user_id);
    @Select("SELECT activity_id ,activity_name,activity_description,times FROM `tb_activityinfo` order by `times` desc")
    List<Activity> list();
}
//"SELECT any_value(activity_id) activity_id,any_value(activity_name) activity_name,any_value(times) times\n" +
//            "FROM `tb_activityinfo`\n" +
//            "group by times,activity_id where times=#{times}"